
package com.example.myapplication;

import android.annotation.SuppressLint;
import android.os.AsyncTask;

public class MovieDataInitializer {

    @SuppressLint("StaticFieldLeak")
    public static void initializeMovieData(MovieDao movieDao) {
        new AsyncTask<Void, Void, Void>() {
            @SuppressLint("StaticFieldLeak")
            @Override
            protected Void doInBackground(Void... voids) {
                movieDao.insertMovie(new Movie("控方证人", R.drawable.kfzr));
                movieDao.insertMovie(new Movie("堤",  R.drawable.di));
                movieDao.insertMovie(new Movie("肖申克的救赎",R.drawable.shawshank));
                movieDao.insertMovie(new Movie("霸王别姬", R.drawable.bwbj));
                movieDao.insertMovie(new Movie("天空之城",  R.drawable.tkzc));
                movieDao.insertMovie(new Movie("了不起的盖茨比",R.drawable.gcb));
                movieDao.insertMovie(new Movie("花样年华", R.drawable.hynh));
                movieDao.insertMovie(new Movie("猫鼠游戏",  R.drawable.msyx));
                movieDao.insertMovie(new Movie("千与千寻",R.drawable.qyqx));
                movieDao.insertMovie(new Movie("沉默的羔羊", R.drawable.silencelambs));
                movieDao.insertMovie(new Movie("赎罪",  R.drawable.atonement));
                movieDao.insertMovie(new Movie("无间道",R.drawable.wjd));
                movieDao.insertMovie(new Movie("喜剧之王", R.drawable.xjzw));
                movieDao.insertMovie(new Movie("摩登时代",  R.drawable.modermtimes));
                movieDao.insertMovie(new Movie("源代码",R.drawable.souurcecode));
                movieDao.insertMovie(new Movie("我是欧嘉", R.drawable.olga));
                movieDao.insertMovie(new Movie("十二怒汉",  R.drawable.angrymen12));
                movieDao.insertMovie(new Movie("泰塔尼克号",R.drawable.titanic));
                movieDao.insertMovie(new Movie("这个杀手不太冷", R.drawable.killer));
                movieDao.insertMovie(new Movie("2001太空漫游",  R.drawable.space2001));
                movieDao.insertMovie(new Movie("西西里的美丽传说",R.drawable.xxl));
                movieDao.insertMovie(new Movie("三傻大闹宝莱坞", R.drawable.idiots3));
                movieDao.insertMovie(new Movie("致命ID", R.drawable.zmid));
                movieDao.insertMovie(new Movie("黑客帝国",  R.drawable.thematrix));
                movieDao.insertMovie(new Movie("低俗小说",R.drawable.dsxs));
                movieDao.insertMovie(new Movie("心灵捕手", R.drawable.xlbs));
                movieDao.insertMovie(new Movie("教父",  R.drawable.godfather));
                movieDao.insertMovie(new Movie("活着",R.drawable.lifetimes));
                movieDao.insertMovie(new Movie("乱世佳人",R.drawable.gone));
                movieDao.insertMovie(new Movie("让子弹飞", R.drawable.rzdf));
                movieDao.insertMovie(new Movie("何以为家",  R.drawable.hywj));
                movieDao.insertMovie(new Movie("摔跤吧！爸爸",R.drawable.sjb));
                movieDao.insertMovie(new Movie("蝴蝶效应", R.drawable.hdxy));
                movieDao.insertMovie(new Movie("罗马假日",  R.drawable.romanholiday));
                movieDao.insertMovie(new Movie("雨中曲",R.drawable.singinintherain));

                return null;
            }
        }.execute();
    }
}